home *** CD-ROM | disk | FTP | other *** search
/ Sports Illustrated for Kids - Awesome Athletes! / Sports Illustrated for Kids - Awesome Athletes!.iso / sikids2.dir / 00001_Movie Script.ls next >
Encoding:
Text File  |  1996-04-18  |  4.9 KB  |  178 lines

  1. on startMovie
  2.   global gSISystem, gSIVideo, gSIVideoPath, gSICDPath, gSIBackground, gSIHWnd
  3.   identifySystem()
  4.   if gSISystem = "UNKNOWN" then
  5.     errorExit("Cannot establish system type")
  6.     return 
  7.   end if
  8.   initGlobals()
  9.   initXObjects()
  10.   if not (the result) then
  11.     errorExit("Internal Error")
  12.     return 
  13.   end if
  14.   if objectp(gSIBackground) then
  15.     gSIBackground(mHideInBack, 0)
  16.     gSIBackground(mSetColor, 255)
  17.     gSIBackground(mShow)
  18.   end if
  19.   HSInit()
  20.   GSInit()
  21.   GSLoad("awesome")
  22.   readGlobalPrefs()
  23.   if not (the result) then
  24.     errorExit("Error Reading Global Prefs.  Awsome.ini may not exist")
  25.     return 
  26.   end if
  27.   if not fileExists(gSICDPath & "intro.dir") then
  28.     errorExit("Cannot find Awesome Athletes CD-ROM")
  29.     return 
  30.   end if
  31.   identifyVideo()
  32.   if gSIVideo = "UNKNOWN" then
  33.     errorExit("Cannot establish video type")
  34.     return 
  35.   end if
  36.   DVInit(gSISystem, gSIVideo)
  37.   if not (the result) then
  38.     errorExit("Error setting up digital video")
  39.     return 
  40.   end if
  41.   IAInit()
  42.   GetWindowHandles()
  43.   SetCursor(#wait)
  44.   go(1, "intro")
  45. end
  46.  
  47. on initGlobals
  48.   global gSIPrefPath, gSIHDPath, gSICDPath, gSIXSuffix, gSIFileType, gSISystem, gSIUser, gSIUserFName, gSIPathSep, gSIlinkinfo
  49.   set gSIHDPath to the moviePath
  50.   set gSIPrefPath to gSIHDPath
  51.   set gSIUser to EMPTY
  52.   set gSIUserFName to EMPTY
  53.   if gSISystem = "MAC" then
  54.     set gSIXSuffix to EMPTY
  55.     set gSIFileType to "TEXT"
  56.     set gSIPathSep to ":"
  57.   else
  58.     set gSIXSuffix to ".DLL"
  59.     set gSIFileType to "PRF"
  60.     set gSIPathSep to "\"
  61.   end if
  62.   set gSIlinkinfo to EMPTY
  63. end
  64.  
  65. on initXObjects
  66.   global gSIXSuffix, gSIUtils, gSIEventQ, gSISystem, gSIFlush, gSIBackground, gSIPPReadInt, gSIPPWrite, gSIMiscX, gSIWinHelp, gSIActiveWindow, gSIShowWindow, gSIGotoURL
  67.   if gSISystem = "MAC" then
  68.     openXLib("MOVUTILS" & gSIXSuffix)
  69.     openXLib("FlushXObj" & gSIXSuffix)
  70.     openXLib("backdrop xobj" & gSIXSuffix)
  71.     openXLib("Misc_X" & gSIXSuffix)
  72.     set gSIUtils to MovieUtilities(mnew)
  73.     if not objectp(gSIUtils) then
  74.       return 0
  75.     end if
  76.     set gSIFlush to FlushXObj(mnew)
  77.     if not objectp(gSIFlush) then
  78.       return 0
  79.     end if
  80.     set gSIBackground to backdrop(mnew)
  81.     if not objectp(gSIFlush) then
  82.       return 0
  83.     end if
  84.   else
  85.     if gSISystem = "WIN" then
  86.       openXLib("FILEIO" & gSIXSuffix)
  87.       openXLib("MOVUTILS" & gSIXSuffix)
  88.       openXLib("EventQ" & gSIXSuffix)
  89.       openXLib("DLLGLUE" & gSIXSuffix)
  90.       openXLib("Misc_X" & gSIXSuffix)
  91.       set gSIUtils to MovUtils(mnew)
  92.       if not objectp(gSIUtils) then
  93.         return 0
  94.       end if
  95.       set gSIEventQ to EventQ(mnew)
  96.       if not objectp(gSIEventQ) then
  97.         return 0
  98.       end if
  99.       set gSIPPReadInt to DLLGLUE(mnew, "KRNL386.EXE", "GetPrivateProfileInt", "W", "SSWS")
  100.       if not objectp(gSIPPReadInt) then
  101.         put "Duck1"
  102.         return 0
  103.       end if
  104.       set gSIPPWrite to DLLGLUE(mnew, "KRNL386.EXE", "WritePrivateProfileString", "W", "SSSS")
  105.       if not objectp(gSIPPWrite) then
  106.         return 0
  107.       end if
  108.       set gSIWinHelp to DLLGLUE(mnew, "USER.EXE", "WinHelp", "W", "WSWU")
  109.       if not objectp(gSIWinHelp) then
  110.         return 0
  111.       end if
  112.       set gSIActiveWindow to DLLGLUE(mnew, "USER.EXE", "GetActiveWindow", "W", "V")
  113.       if not objectp(gSIActiveWindow) then
  114.         return 0
  115.       end if
  116.       set gSIShowWindow to DLLGLUE(mnew, "USER.EXE", "ShowWindow", "W", "WW")
  117.       if not objectp(gSIShowWindow) then
  118.         return 0
  119.       end if
  120.       openXLib("SIUTILS.DLL")
  121.       set gSIGotoURL to DLLGLUE(mnew, "SIUTILS.DLL", "GotoURL", "V", "WS")
  122.       if not objectp(gSIGotoURL) then
  123.         return 0
  124.       end if
  125.     end if
  126.   end if
  127.   set gSIMiscX to Misc_X(mnew)
  128.   if not objectp(gSIMiscX) then
  129.     return 0
  130.   end if
  131.   return 1
  132. end
  133.  
  134. on errorExit aText
  135.   set the text of cast "Error Text" to aText
  136.   go("Error")
  137. end
  138.  
  139. on readGlobalPrefs
  140.   global gSIPrefPath, gSICDPath, gSIPathSep, gSIVideoPath, gSIAudioPath, gSIImagePath, gSIBioPath
  141.   set vFile to FileIO(mnew, "read", the moviePath & "awesome.ini")
  142.   if not objectp(vFile) then
  143.     return 0
  144.   end if
  145.   set vFound to 0
  146.   repeat while objectp(vFile) and not vFound
  147.     set vLine to vFile(mReadLine)
  148.     if vLine contains "CDROMPATH=" then
  149.       set vFound to 1
  150.     end if
  151.   end repeat
  152.   if objectp(vFile) then
  153.     vFile(mdispose)
  154.   end if
  155.   delete char 1 to 11 of vLine
  156.   set gSICDPath to stripCRLF(vLine)
  157.   set gSICDPath to gSICDPath & gSIPathSep
  158.   set gSIVideoPath to gSICDPath & "video" & gSIPathSep
  159.   add(the searchPath, gSICDPath)
  160.   return 1
  161. end
  162.  
  163. on GetWindowHandles
  164.   global gSISystem, gSIHWnd, gSIHParentWnd, gSIUtils
  165.   if gSISystem = "WIN" then
  166.     set gSIHWnd to gSIUtils(mGetNamedWindowHdl, "Stage")
  167.     set vGetParent to DLLGLUE(mnew, "USER.EXE", "GetParent", "W", "W")
  168.     if not objectp(gSIWinHelp) then
  169.       return 
  170.     end if
  171.     set gSIHParentWnd to vGetParent(mCall, gSIHWnd)
  172.     set gSIHParentWnd to vGetParent(mCall, gSIHParentWnd)
  173.     vGetParent(mdispose)
  174.   else
  175.     set gSIHWnd to 0
  176.   end if
  177. end
  178.